/**
 * @file
 * @description  用户登录
 */


import request from './request'

/**
 * @methods
 * @description 登录
 * @param {object} model  用户登录信息
 */


export const login = (model) => request.post('login', model);
/**
 *@method 
 * @description
 *@param  {object} model  
 */
export const GetUser = (model) => request.get('users', { params: model });
/**
 * @method
 * @description
 * @param  {Number} id
 * @param state   要修改的状态
 * @param  {boolean}
 */
export const changestate = (id, state) => request.put(`users/${id}/state/${state}`)

/**
 * @methods
 * @description
 * @param{object} 
 * 添加 用户
 */
export const adduser = (model) => request.post('users', model);
/**
 * @methods
 * @description
 * @param{object}
 * 修改
 */
export const edituser = (model) => request.put(`users/${model.id}`, model)

/**
 * 删除
 */
export const deleteuser = (id) => request.delete(`users/` + id)